//
//  BigImageTableViewCell.m
//  WWXELuShang
//
//  Created by lanou on 15/12/19.
//  Copyright © 2015年 lanou. All rights reserved.
//

#import "BigImageTableViewCell.h"
#import "ImageListModel.h"

@implementation BigImageTableViewCell



- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        _titleLabel = [[UILabel alloc]initWithFrame:CGRectMake(kWidth / 40, kWidth / 40, kWidth - kWidth / 20, kHeight / 30)];
        [self.contentView addSubview:_titleLabel];
        
        _iconView = [[UIImageView alloc]initWithFrame:CGRectMake(kWidth / 40, kWidth / 20 + kHeight / 30 , kWidth - kWidth / 20, kWidth * 19 / 60)];
        [self.contentView addSubview:_iconView];
        
        _srcLabel = [[UILabel alloc]initWithFrame:CGRectMake(kWidth / 40, kWidth / 40 * 3 + kHeight / 30 + kWidth * 19 / 60, kWidth / 3, kHeight / 30)];
        [self.contentView addSubview:_srcLabel];
        
        _srcLabel.font = [UIFont systemFontOfSize:12];
        _srcLabel.textColor = [UIColor grayColor];
    }
    return self;
    
}


- (void)setImageList:(ImageListModel *)imageList {
    
    if (_imageList != imageList) {
        _imageList = imageList;
        _titleLabel.text = imageList.title;
        [_iconView setImageWithURL:[NSURL URLWithString:imageList.pictureArray[0]]];
        _srcLabel.text = imageList.src;
    }
}


- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
